var qrcode = document.getElementById('qrcode')
chrome.tabs.query({ active: true, currentWindow: true },
    function (tabs) {
        var url = tabs.length ? tabs[0].url : ''  // 获取当前 tab url 
        new QRCode(document.getElementById('qrcode'), {
            text: url,
            width: 128,
            height: 128,
            colorDark: "#000000",
            colorLight: "#ffffff", 
        });
    });